package com.bum.api.processor.dict.html;

import org.apache.commons.lang.StringUtils;

import com.bum.api.core.exp.om.Metas;
import com.bum.api.core.exp.om.Params;
import com.bum.api.core.service.process.ApiProcess;
import com.bum.api.processor.dict.html.bo.DictHtmlBO;

public class DictHtmlProcess extends ApiProcess {
	enum Func {
		data;
		public static Func val(String val) {
			try {
				return valueOf(val);
			} catch (Exception e) {
				return null;
			}
		}
	}

	DictHtmlBO	dictHtmlBO;

	@Override
	public String process(String path, Params params, Metas metas) {
		String[] parts = StringUtils.split(path, "/", 3);
//		if (parts.length > 1) {
//			Func func = Func.val(parts[1]);
//			if (func != null) {
//				switch (func) {
//					case data:
//						return quizDataBO.process(parts.length == 3 ? parts[2] : null, params, metas);
//				}
//			}
//		}

		return dictHtmlBO.home(parts.length == 2 ? parts[1] : null, params, metas);
	}

	public void setDictHtmlBO(DictHtmlBO dictHtmlBO) {
		this.dictHtmlBO = dictHtmlBO;
	}
}